﻿using Basic.FlowApplication.Interface;
using Basic.FlowRemoteModel;
using WeDonekRpc.Client.Interface;

namespace Basic.FlowApplication.AuditLocalEvent.AuditEvent
{
    internal class NoticeMsgEvent : IEventHandler<FlowAuditEvent>
    {
        private readonly IAuditNoticeMsgService _NoticeMsg;

        public NoticeMsgEvent ( IAuditNoticeMsgService noticeMsg )
        {
            this._NoticeMsg = noticeMsg;
        }

        public void HandleEvent ( FlowAuditEvent data, string eventName )
        {
            if ( data.Item.NodeType == FlowNodeType.结束节点 )
            {
                return;
            }
            this._NoticeMsg.HandlerMsg(data.Log, data.Item, data.Flow);
        }
    }
}
